Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aggregator] Pool locked aggregations #4109

Merged
merged 5 commits into from
May 2, 2022
Merged

[aggregator] Pool locked aggregations #4109

merged 5 commits into from
May 2, 2022

Conversation

vdarulis
Copy link
Collaborator

@vdarulis vdarulis commented May 1, 2022

What this PR does / why we need it:

This is about ~30% allocs by space on timed metric heavy workloads:
Screen Shot 2022-05-01 at 4 06 55 PM

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:


Does this PR require updating code package or user-facing documentation?:


@vdarulis vdarulis marked this pull request as ready for review May 2, 2022 02:51
src/aggregator/aggregator/generic_elem.go Show resolved Hide resolved
sourcesSeen map[uint32]*bitset.BitSet,
) *lockedCounterAggregation {
l := lockedCounterAggregationPool.Get().(*lockedCounterAggregation)
l.aggregation = aggregation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could factor the zeroing into a reset method, and reuse here + in close? Not a huge deal though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simplified and made close() foolproof

@vdarulis vdarulis merged commit 736243d into master May 2, 2022
@vdarulis vdarulis deleted the v/locked_agg branch May 2, 2022 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants